include SETTINGS

install:
	$(MKDIR) -p $(DBDESC)/dbserver
	$(CP) db_desc_example/dbserver/* $(DBDESC)/dbserver
	$(MKDIR) -p $(DBDATA)
	$(MKDIR) -p $(DBHOME)
	$(MKDIR) -p $(DBTYPES)
	$(MKDIR) -p $(DBTEMPLATES)
	-$(MKDIR) -p $(DBADD)
	$(CP) html_templates/* $(DBTEMPLATES)
	$(CP) db_types_example/* $(DBTYPES)
	$(MKDIR) -p $(DBHOME)/pictures
	$(MKDIR) -p $(DBHOME)/stats
	chmod a+rw $(DBHOME)/stats
	$(CP) pictures/* $(DBHOME)/pictures
	$(MKDIR) -p $(DBHOME)/admin
	$(CP) startdbserver.cgi $(DBHOME)/admin
	$(CP) ./utils/graph $(DBHOME)/admin
#	-$(CP) ciaoengine $(CIAOBIN)
	echo "# dbserver log file" > $(DBHOME)/admin/dbserver.log
	chmod a+w $(DBHOME)/admin/dbserver.log
	cd src; $(MAKE) exec
	cd src; $(MAKE) install

exec_headers:
	cd src; $(MAKE) exec_headers

maintenance:
	cd src; $(MAKE) maintenance

clean:
	cd src; $(MAKE) clean

distclean:
	cd src; $(MAKE) distclean
	cd doc; $(MAKE) distclean

